package com.tjsinfo.tjsoa.doc.bo;

import java.util.List;

import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Order;
import org.hibernate.criterion.Restrictions;

import com.tjsinfo.tjsoa.Dao.IQbcDao;
import com.tjsinfo.tjsoa.doc.dao.ITDocDocOpeDAO;
import com.tjsinfo.tjsoa.doc.vo.TDocDocOpe;

public class TDocDocOpeBO implements ITDocDocOpeBO {
	private IQbcDao qbcDao;
	private ITDocDocOpeDAO docOpeDao;

	public void setQbcDao(IQbcDao qbcDao) {
		this.qbcDao = qbcDao;
	}
	public void setDocOpeDao(ITDocDocOpeDAO docOpeDao) {
		this.docOpeDao = docOpeDao;
	}
	
	public void save(TDocDocOpe transientInstance) {
		// TODO Auto-generated method stub
		docOpeDao.save(transientInstance);
	}
	
	public void deleteA(String docId) {
		// TODO Auto-generated method stub
		docOpeDao.deleteA(docId);
	}

	public List<TDocDocOpe> selectDocId(String docId) {
		// TODO Auto-generated method stub
		DetachedCriteria detachedCriteria = DetachedCriteria.forClass(TDocDocOpe.class);
		detachedCriteria.add(Restrictions.eq("docId", docId));
		detachedCriteria.addOrder(Order.desc("dateTime"));
		return qbcDao.getCriteria(detachedCriteria);
	}

}
